<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li><a href="index.html">主页</a></li>
			<li><a>欢乐送活动查询</a></li>
			<li class="active"><strong>欢乐送商户查询</strong></li>
		</ol>
	</div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn"
	ng-controller="activityCtrl">
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>欢乐送查询条件</h5>
				</div>
				<div class="ibox-content">
					<form class="form-horizontal" id="form1">
						<div class="row">
							<div class="col-lg-12">
								<div class="panel-body ibox float-e-margins">
									<div class="ibox-content">
										<div class="form-group">
											<label class="col-sm-2 control-label">商户名称/编号：</label>
											<div class="col-sm-2">
												<input type="text" class="form-control" onchange="keyChange()"
													ng-model='baseInfo.merchantN'>
											</div>
											<label class="col-sm-2 control-label">代理商名称/编号：</label>
											<div class="col-sm-2">
												<select  name="autocomplete-select" id="autocomplete-select1"
														 ng-model="baseInfo.agentN" ng-options="x.value as x.text for x in agent"
													style="width: 100%" chosen chosen-data="agent" chosen-keyup="getStates" ng-change="changeAgentNode()">
												</select>

											</div>
											<label class="col-sm-2 control-label">一级代理商:</label>
											<div class="col-sm-2">
												<select name="autocomplete-select" id="autocomplete-select2"
														ng-model="baseInfo.oneAgentNo" ng-options="x.value as x.text for x in oneAgent"
														style="width: 100%" chosen chosen-data="oneAgent" chosen-keyup="getStatesOne">
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label">商户类型：</label>
											<div class="col-sm-2">
												<select ng-disabled="disabledMerchantType" style="width: 100%"  class="form-control" ng-model='baseInfo.merchantType'>
													<option value="1" selected>直营商户</option>
													<option value="2">所有下级代理商商户</option>
													<option value="3">所有商户</option>
												</select>
											</div>
											<label class="col-sm-2 control-label">收单机构:</label>
											<div class="col-sm-2">
												<select class="form-control" ng-model="baseInfo.acqOrgId" ng-options="x.value as x.text for x in acqOrgs">
												</select>
											</div>
											<label class="col-sm-2 control-label">活动状态：</label>
											<div class="col-sm-2">
												<select class="form-control" ng-model='baseInfo.status' ng-change="changeActivityStatus()"
														ng-options="x.value as x.text for x in activityStatusAll">
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label">冻结金额：</label>
											<div class="col-sm-2">
												<input type="number" class="form-control"
													   ng-model='baseInfo.frozenAmout'>
											</div>
											<label class="col-sm-2 control-label">是否扣回：</label>
											<div class="col-sm-2">
												<select class="form-control" ng-model='baseInfo.discountStatus'
														ng-options="x.value as x.text for x in discountStatus">
												</select>
											</div>
											<label class="col-sm-2 control-label">核算状态：</label>
											<div class="col-sm-2">
												<select class="form-control" ng-model='baseInfo.checkStatus'
														ng-options="x.value as x.text for x in checkStatusAll">
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label">激活日期：</label>
											<div class="col-sm-5">
												<input id="d5221" class="form-control" type="datetime" ng-model="baseInfo.activeTimeStart" onchange=""  style="width:auto;display:inline-block;"
													   onFocus="var d5222=$dp.$('d5222');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',/*changed:verifyTime(1,'#d5221','#d5222',31,isVerifyTime),*/onpicked:function(){d5222.focus();},maxDate:'#F{$dp.$D(\'d5222\')||\'%y-%M-%d\'}'})"/>
												~
												<input id="d5222" class="form-control" type="datetime"  ng-model="baseInfo.activeTimeEnd" onchange=""  style="width:auto;display:inline-block;"
													   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',/*changed:verifyTime(2,'#d5221','#d5222',31,isVerifyTime),*/minDate:'#F{$dp.$D(\'d5221\')}',maxDate:'%y-%M-%d 23:59:59'})"/>
												<br/><span><font color="#999">备注：查询范围不能超过一个月</font></span>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label">进件时间：</label>
											<div class="col-sm-5">
												<input id="d5241" class="form-control" type="datetime" ng-model="baseInfo.enterTimeStart" onchange=""  style="width:auto;display:inline-block;"
													  onFocus="var d5242=$dp.$('d5242');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',/*changed:verifyTime(1,'#d5241','#d5242',31,isVerifyTime),*/onpicked:function(){d5242.focus();},maxDate:'#F{$dp.$D(\'d5242\')||\'%y-%M-%d\'}'})"/>
												~
												<input id="d5242" class="form-control" type="datetime"  ng-model="baseInfo.enterTimeEnd" onchange=""  style="width:auto;display:inline-block;"
													   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',/*changed:verifyTime(2,'#d5241','#d5242',31,isVerifyTime),*/minDate:'#F{$dp.$D(\'d5241\')}',maxDate:'%y-%M-%d 23:59:59'})"/>
												<br/><span><font color="#999">备注：查询范围不能超过一个月</font></span>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label">商户提现时间：</label>
											<div class="col-sm-5">
												<input id="d5231" class="form-control" type="datetime" ng-model="baseInfo.cashTimeStart" onchange=""  style="width:auto;display:inline-block;"
													   onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5232.focus();},maxDate:'#F{$dp.$D(\'d5232\')}'})"/>
												~
												<input id="d5232" class="form-control" type="datetime"  ng-model="baseInfo.cashTimeEnd" onchange=""  style="width:auto;display:inline-block;"
													   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
											</div>
										</div>

										<div class="form-group">
											<label class="col-sm-2 control-label">激活订单号：</label>
											<div class="col-sm-9">
											<textarea class="form-control" rows="6" cols="10" ng-model="baseInfo.activeOrder" onchange="keyChange()"></textarea>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2"></label>
											<div class="col-sm-10">
												<button class="btn btn-primary6 btn-mr20" type="button"
													ng-click='query()' >查询</button>
													<button class="btn btn-primary3 btn-mr20" type="button"
													ng-click="resetForm()">清空</button>
												<button class="btn btn-new btn-mr20" type="button" ng-show="hasPermit('activity.exportExcel')"
													ng-click="exportExcel()">导出</button>
												<button class="btn btn-new btn-mr20" type="button" ng-show="hasPermit('activity.importDiscount')"
													ng-click="importDiscountShow()">回盘导入</button>
												<button class="btn btn-new btn-mr20" type="button" ng-show="hasPermit('activity.happySendActivityAdjust')"
													ng-click="checkBatch()">批量核算</button>
												<a href="activityDetail/downloadTemplate">回盘文件</a>
											</div>
										</div>
									</div>
								</div>

								<div class="panel-body ibox float-e-margins">
									<div class="ibox-title">
										<h5>业务信息列表</h5>
									</div>
									<div class="ibox-content">
										<div class="col-sm-3">
											&nbsp;&nbsp;
											<label>
												<input type="checkbox" ng-model='baseInfo.pageAll' ng-click="pageAllClick()" />全选当前页
											</label>
											&nbsp;&nbsp;&nbsp;&nbsp;
											<label>
												<input type="checkbox" ng-model='baseInfo.countAll' ng-click="countAllClick()" />全选所有
											</label>
										</div>
										<div class="col-sm-3 checkbox" style="color: red;">已提交待核算:<span ng-bind="accountCheckTotal"></span>笔</div>
									</div>
									<div class="ibox-content">
										<div class="tposition">
											<div ui-grid="activityGrid" ui-grid-pagination ui-grid-selection ui-grid-resize-columns ui-grid-pinning class="grid"></div>
												<div ng-show="loadImg" class="timg"></div>
										</div>
									</div>
								</div>
								<div style="height: 50px"></div>
							</div>
						</div>
					</form>
					<!-- add import -->
					<form class="form-horizontal" id="form2" name="horizontalAdd" novalidate>
						<div id="importDiscount" class="modal fade" tabindex="-1" role="dialog">
							<div class="modal-dialog" style="width: 900px">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal">
											&times;</button>
										<h3 class="modal-title">回盘导入</h3>
									</div>
									<div class="modal-body">
									<div class="form-group">
										<label class="col-sm-2 control-label">导入文件：</label>
										<div class="col-sm-3 checkbox ">
											<input type="file" nv-file-select="" ng-model="fileSelect" uploader="uploader" multiple/>
											<table class="table">
										        <tbody>
													<tr ng-repeat="item in uploader.queue">
														<td>
															<strong>{{ item.file.name }}</strong>
														</td>
														<td nowrap>
															<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
																<span class="glyphicon glyphicon-trash"></span>删除
															</button>
														</td>
													</tr>
												</tbody>
											</table>
										</div>
										<label class="col-sm-2 control-label"></label>
										<div class="col-sm-3 checkbox ">
											<a href="activityDetail/downloadTemplate" >回盘文件</a>
										</div>
									</div>
										<div class="form-group">
											<label class="col-sm-2 control-label"></label>
											<div class="col-sm-6">
												<button class="btn btn-primary btn-mr20" type="button" ng-click='importDiscount()'
													id="btnSubmit" ng-disabled="uploader.queue.length==0||submitting">提交</button>
													<button class="btn btn-primary8" type="button" ng-click='cancel()'
													>取消</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						</form>
						<!-- add -->
						<!-- add check -->
						<form class="form-horizontal" id="form3" name="horizontalCheck" novalidate>
						<div id="checkModal" class="modal fade" tabindex="-1" role="dialog">
							<div class="modal-dialog" style="width: 900px">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal">
											&times;</button>
										<h3 class="modal-title">核算审核</h3>
									</div>
									<div class="modal-body">
									<div class="form-group">
										<label class="col-sm-2 control-label"></label>
										<div class="col-sm-3 checkbox ">
											<label ><input type="radio" name="dicountStatus" ng-model="checkStatus" value="1" />同意</label>
											<label ><input type="radio" name="dicountStatus" ng-model="checkStatus" value="2" />不同意</label>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label"></label>
										<div class="col-sm-6">
											<button class="btn btn-primary btn-mr20" type="button" ng-click='submitCheck()'
												 ng-disabled="submitting">提交</button>
												<button class="btn btn-primary8" type="button" ng-click='cancel()'
												>取消</button>
										</div>
									</div>
								</div>
							</div>
						</div>
						</div>
						</form>
						<!-- add -->
				</div>
			</div>
		</div>
	</div>
	<div style="height: 30px;"></div>
</div>